<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
		</script>

		<script>
			function getVideo() {
				var videoPath = document.getElementById("videopath").value;

				$.post("https://analyse.layzz.cn/lyz/platAnalyse/", {
					'token': 'uuic-qackd-fga-test',
					'link': videoPath
				}, function(data, status) {
					var newPath = data['data']['playAddr'];
					document.getElementById("newVideoPath").textContent = newPath;
				});
			}

			function copy() {
				// var e = document.getElementById("newVideoPath");

				const range = document.createRange();
				range.selectNode(document.getElementById('newVideoPath'));

				const selection = window.getSelection();
				if (selection.rangeCount > 0) selection.removeAllRanges();
				selection.addRange(range);
				document.execCommand('copy');
				alert("复制成功！");
			}
		</script>
		<head>
		<body>
			<div>
				<h3>视频地址</h3>
				<input id="videopath"></input>
				<button onclick='getVideo()'>解析</button>
			</div>

			<div>
				<H3>解析后视频地址:<button onclick='copy()'>复制</button></h3>
				<h3 id="newVideoPath"></h3>
			</div>
		</body>


</html>
